package com.wish.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Utils
{

	private static final String YYYY_MM_DD_HH24_MM_SS = "yyyy-MM-dd HH:mm:ss";

	public static Date getCurrentDateTimeDate()
	{
		try
		{
			SimpleDateFormat formatter = new SimpleDateFormat(YYYY_MM_DD_HH24_MM_SS);
			return formatter.parse(getCurrentDateTime());
		}
		catch (Exception e)
		{
			return null;
		}
	}

	public static String getCurrentDateTime()
	{
		try
		{
			SimpleDateFormat formatter = new SimpleDateFormat(YYYY_MM_DD_HH24_MM_SS);

			Calendar curdate = null;
			curdate = Calendar.getInstance();
			Date currentDate = curdate.getTime();
			return formatter.format(currentDate);
		}
		catch (Exception e)
		{
			return null;
		}
	}
}
